// 按钮级权限
import BLCOMMON from "bl-common-vue3";
const BUTTON_PERMISSION = {
  setButtonPermission: (menu) => {
    let permisson = {};
    for (let menuItem of menu) {
      const { action, alias } = menuItem;
      if (action && typeof action == "object" && Object.keys(action).length) {
        permisson[alias] = {};
        for (let actionKey in action) {
          permisson[alias][actionKey] = action[actionKey];
        }
      }
    }
    // console.log("--------------permisson", permisson);
    BLCOMMON.utils.setSystemBtnPermission(permisson);
  },
};

export default BUTTON_PERMISSION;
